package com.qf.dao;

import com.qf.entity.Daily;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DailyMapper {
    /**
     * 查询所有
     */
    @Select("select * from daily")
    List<Daily> selectAllDaily();

    /**
     * 新增日报
     */
    @Insert("insert into daily values (#{id},#{title},#{content},#{time},#{username},#{gain})")
    int insertDaily(Daily daily);

    /**
     * 动态更新日报
     */
    int updateDaily(Daily daily);

    /**
     * 删除日报
     */
    @Delete("delete from daily where id = #{id}")
    int deleteDaily(Integer id);
}
